package com.pruebas.andengine;

import org.anddev.andengine.entity.sprite.AnimatedSprite;
import org.anddev.andengine.input.touch.detector.HoldDetector;
import org.anddev.andengine.input.touch.detector.HoldDetector.IHoldDetectorListener;
import org.anddev.andengine.opengl.texture.region.TiledTextureRegion;

import android.util.Log;

public class Player extends AnimatedSprite {

	private static final String TAG = "Player";
	private static final int PLAYER_CHARGE_ANIMATIONS = 5;

	public Player(float pX, float pY, TiledTextureRegion pTiledTextureRegion) {
		super(pX, pY, pTiledTextureRegion);
	}

	public void setCharge(final float angle, final float distance)

	{

		final int step = Math.round(distance * PLAYER_CHARGE_ANIMATIONS
				/ Main.MAX_CHARGE_DISTANCE);
		this.stopAnimation(step);
		this.setRotation(angle);

	}

}
